My presentation for the 2008 online conference. Learn how to use SWFObject 2 to embed Adobe Flash content into web pages. This session will discuss all ins and outs, from the most basic hello world example to topics like Full Browser Flash, ActionScript-to-JavaScript communication, alternative content for people without Flash, SEO, Adobe Express Install and hacking around with the new SWFObject 2 JavaScript API.
10. Static publishing
HTML to embed SWF content
and alternative content
Unobtrusive JavaScript to resolve
issues
11. Dynamic publishing
HTML to define alternative content
Unobtrusive JavaScript to replace this
with a SWF when the required Flash Player
and JavaScript support is available
41. Doesn't Google index SWFs?
Google indexes both alternative and
SWF content
Not all search engines index SWF
content
SWF indexing is still limited: text
and links only
42. The power of HTML content
1. Descriptive
2. Hierarchy
3. Semantics
43. Make sure that your alternative content
truly reflects your Flash content
51. Summarizing
1. 100% width and height
2. Add CSS to get rid of default
margin/padding and set the height
of all parent containers for Firefox
52. Scaling and alignment
Manage from within SWF
Always use a resize handler
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener(Event.RESIZE, resizeHandler);
function resizeHandler(event:Event):void {
// e.g. center stuff
}
54. External Interface
Allows two-way communication
between SWF and an HTML page
Flash Player 8+
ActionScript 2
http://livedocs.adobe.com/flash/8/main/00002200.html
55. The example
JavaScript to ActionScript
To register an AS method as
callable from JS:
addCallback(methodName:String, instance:Object,
method:Function):Boolean
65. Summarizing
1. Register an AS method as callable
from JS
2. Add an ID to your object element
3. Call your AS method from JS
66. Static publishing
Uses nested objects
Add an ID to your outer object
element only
To reference your active object
element use:
swfobject.getObjectById(objectIdStr)
68. SWFObject JavaScript API
Focuses on publishing SWFs and
detecting Flash Player
Lets developers reuse SWFObject's
internal functions
http://code.google.com/p/swfobject/wiki/api